﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace HgCo.WindowsLive.SkyDrive.TotalCommander.Plugins.Forms
{
    /// <summary>
    /// Represents a window for displaying webfolder information.
    /// </summary>
    internal partial class SkyDriveWfxFolderInfoForm : Form
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SkyDriveWfxFolderInfoForm"/> class.
        /// </summary>
        internal SkyDriveWfxFolderInfoForm(WebFolderInfo webFolder, Image webFolderIcon)
        {
            InitializeComponent();

            this.Icon = Resources.SkyDriveWfx.mini_storage;

            txtName.Text = webFolder.Name;
            txtDescription.Text = webFolder.Description;
            txtShareType.Text = webFolder.ShareType.ToString();
            txtContentType.Text = webFolder.CategoryType.ToString();
            txtSize.Text = webFolder.Size.ToString();
            txtDateModified.Text = webFolder.DateModified.ToString();
            //txtViewUri.Text = webFolder.ViewUrl != null ? webFolder.ViewUrl : String.Empty;

            picboxIcon.Image = webFolderIcon;
        }

        /// <summary>
        /// Handles the KeyDown event of the SkyDriveWfxFolderInfoForm control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.KeyEventArgs"/> instance containing the event data.</param>
        private void SkyDriveWfxFolderInfoForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                this.Close();
            }
        }
    }
}
